package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("Spring的容器正在初始化....");
        AnnotationConfigApplicationContext context=
                new AnnotationConfigApplicationContext("demo7");
        System.out.println("Spring容器初始化完毕!!!");
        System.out.println("正在向Spring容器获取Person对象...");
        Person person=context.getBean(Person.class);
        System.out.println("获取Person对象完毕!!!");
        person.play();
        System.out.println("Spring容器关闭中....");
        context.close();
        System.out.println("Spring容器已关闭 ");


    }
}
